
import java.util.ArrayList;
import java.util.List;
public class BranchCource extends GKAbstractCource {

    private List<GKAbstractCource> courceList = new ArrayList<>();
    private String name;
    private int level;

    public BranchCource(String name, int level) {
        this.name = name;
        this.level = level;
    }


    public void addChild(GKAbstractCource cource) {
        courceList.add(cource);
    }

    public String getName() {
        return this.name;
    }

    public void info() throws Exception {
        System.out.println("课程：" + this.name);
        for (GKAbstractCource cource : courceList) {
            for(int i =0; i< level; i++) {
                System.out.print(" ");
            }
        
            System.out.print(">");
            cource.info();
        }
        
    }
}